/*****************************************************
 * 
 * @author Muhammad Sakeeful Islam
 *
 */
public class Cards {
//assigning values to color of cards
	public static final int RED = 0;
	public static final int GREEN = 1;
	public static final int BLUE = 2;
	public static final int YELLOW = 3;
	public static final int NULL = 4;
//assigning values to power cards	
	public static final int REVERSE = 10;
	public static final int SKIP = 11;
	public static final int DRAW_TWO = 12;
	public static final int WILD = 13;
	public static final int WILD_FOUR = 14;
	private int color;	
	private int card;
	//constructor of cards class
	public Cards(int color, int card) {
		
		if (card < 0 && card < 14) throw new RuntimeException("The card you especified is not valid.");
		this.card = card;
		this.color = color;
		
		if (card == WILD || card == WILD_FOUR) {
			this.color = NULL;
		}
	}
	
	public int getColor() 	//return color
	{
		return color;
	}
	
	public int getValue() //return Value
	{
		return card;
	}
	
	public boolean isNumber()	//if the cards are numbered cards
	{
		return (card >= 0 && card < 10);
	}
	
	public boolean isSkip()	//if the card is skip
	{
		return (card == SKIP);
	}
	
	public boolean isReverse() //if the card is reverse card
	{
		return (card == REVERSE);
	}
	
	public boolean isDrawTwo() //if card is draw2 card
	{
		return (card == DRAW_TWO);
	}
	
	public boolean isWild() //if the card is wild card
	{
		return (color == NULL);
	}
	
	public boolean isWildFour() //if the card is wild four card
	{
		return (card == WILD_FOUR);
	}
	
	public String toString() //to string methods for the cards
	{
		String nameColor = "";
		String number = "";
		
		switch (color) {
			case RED:    nameColor = "Red ";    break;
			case GREEN:  nameColor = "Green ";  break;
			case BLUE:   nameColor = "Blue ";   break;
			case YELLOW: nameColor = "Yellow "; break;
			case NULL:   nameColor = "";       break;
		}
		
		switch (card) {
			case REVERSE:   number = "Reverse";           break;
			case SKIP:      number = "Skip";              break;
			case DRAW_TWO:  number = "Draw Two";          break;
			case WILD:      number = "Wild";               break;
			case WILD_FOUR: number = "Wild \"Draw Four\""; break;
			default:        number = "" + card;                 break;
		}
		
		return (nameColor + number);
	}
	
	
	
	
}